package com.base.cn.platform.os.controller.statistics.goods;

import com.base.cn.platform.os.common.controller.BaseController;
import com.base.cn.platform.os.common.utils.ObjectUtils;
import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.entity.statistics.goods.ZStatisticsGoodsUVCount;
import com.base.cn.platform.os.service.statistics.goods.ZStatisticsGoodsUVCountBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 商品UV统计接口Controller
 *
 * @author s.li
 * @date 2019/04/24
 */
@RestController
@RequestMapping("/manage/statistics")
public class ZStatisticsGoodsUVCountController extends BaseController {

    @Autowired
    private ZStatisticsGoodsUVCountBiz statisticsGoodsUVCountBiz;

    /**
     * 生成商品UV统计记录
     * @param goodsUVCountList UV 数据列表
     */
    @RequestMapping("/genGoodsUVCountList")
    public Map<String,Object> genGoodsUVCountList(@RequestBody List<ZStatisticsGoodsUVCount> goodsUVCountList){
        if(ObjectUtils.isNotEmpty(goodsUVCountList)){
            statisticsGoodsUVCountBiz.genGoodsUVCountList(goodsUVCountList);
            return ResultUtil.SUCCESS();
        }
        return ResultUtil.ERROR("没有数据");
    }

}
